<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Student List Management</title>
    <style>
        table {
            width: 100%;
            border-collapse: collapse;
        }

        table,
        th,
        td {
            border: 1px solid black;
        }

        th,
        td {
            padding: 8px;
            text-align: left;
        }

        th {
            background-color: #f2f2f2;
        }

        /* 弹框样式 */
        .modal {
            display: none;
            /* 初始隐藏 */
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgb(0, 0, 0);
            background-color: rgba(0, 0, 0, 0.4);
        }

        .modal-content {
            background-color: #fefefe;
            margin: 15% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 300px;
            box-sizing: border-box;
        }

        .modal-content label {
            display: block;
            margin-bottom: 5px;
        }

        .modal-content input[type="text"],
        .modal-content input[type="number"],
        .modal-content select {
            width: 100%;
            padding: 8px;
            margin-bottom: 10px;
            box-sizing: border-box;
        }

        .modal-content button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
        }

        .modal-content button:hover {
            background-color: #45a049;
        }

        .tools-header {
            display: flex;
            justify-content: space-between;
        }
    </style>
</head>

<body>
    <h2>Student List Management</h2>
    <div class="tools-header">
        <button class="openModalBtn">Add New Student</button>

        <div>
            <input type="text" name="keyword" class="keyword">
            <button type="button" class="searchBtn">检索</button>
        </div>
    </div>


    <table class="studentTable">
        <thead>
            <tr>
                <th><input type="checkbox" class="selectAll"></th>
                <th>ID</th>
                <th>Name</th>
                <th>Gender</th>
                <th>Hobbies</th>
                <th>邮箱</th>
                <th>手机号</th>
                <th>Age</th>
                <th>添加时间</th>
                <th>修改时间</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <!-- Student rows will be added dynamically here -->
        </tbody>
    </table>

    <!-- 添加/修改学生信息的弹框 -->
    <div class="studentModal modal">
        <div class="modal-content">
            <h3 class="modalTitle">Add New Student</h3>
            <form class="studentForm">
                <input type="hidden" class="studentIdToEdit"> <!-- Hidden input to hold ID for editing -->

                <label for="studentName">Name</label>
                <input type="text" name="name" class="studentName" required>

                <label for="studentGender">Gender</label>
                <select name="gender" class="studentGender" required>
                    <option value="Male">Male</option>
                    <option value="Female">Female</option>
                </select>

                <label for="studentHobbies">Hobbies</label>
                <input type="text" name="hobbies" class="studentHobbies" required>

                <label for="studentIphone">手机号</label>
                <input type="text" name="iphone" class="studentIphone" required>

                <label for="studentEmail">邮箱</label>
                <input type="text" name="email" class="studentEmail" required>

                <label for="studentAge">Age</label>
                <input type="number" name="age" class="studentAge" required>

                <button type="submit" class="saveStudentBtn">Save Student</button>
            </form>
        </div>
    </div>
    <script src="../../../dist/test/4.学生管理页面.js"></script>
</body>

</html>